﻿#pragma once

#include "Core/ConfigArgs.h"
#include "App/Application.h"
#include "Core/Input.h"
#include "Scene/Level.h"
#include "Plugin/PluginManager.h"

class CORE_API Game : public Application
{
  public:
  enum class Mode : uint8_t
  {
    Creative = 0,
    Survival,
  };

public:
  Game(const ConfigArgs &args);
  ~Game();

  static Game& GetInstance();

  virtual void OnInit() override;
  virtual void OnUpdate(float deltaTime) override;
  virtual void OnRender() override;
  virtual void OnRenderGui() override;
  virtual void OnShutdown() override;

  Mode GetGameMode() const { return m_gameMode; }
  bool CheckGameMode(Mode mode) const { return m_gameMode == mode; }
  void SetGameMode(Mode mode);

  Ref<Level> GetLevel() { return m_level; }
  Ref<Input> GetInput() { return m_input; }

private:
  GameArgs m_args;

  PluginManager m_pluginManager;

  Ref<Level> m_level{nullptr};
  Ref<Input> m_input{nullptr};

  Mode m_gameMode = Mode::Creative;
};